package info.touret.winecellar.bottle.client;

import com.google.web.bindery.requestfactory.shared.InstanceRequest;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.Service;
import info.touret.winecellar.bottle.shared.BottleProxy;

import java.util.List;

@Service(info.touret.winecellar.bottle.server.domain.Bottle.class)
public interface BottleRequest extends RequestContext {
	/**
	 * @return La liste des bouteilles
	 */
	Request<List<BottleProxy>> findAllBottles();

	/**
	 * MAJ une bouteille
	 * 
	 */
	InstanceRequest<BottleProxy, Void> persist();

	/**
	 * Supprime la bouteille
	 * 
	 * @return
	 */
	InstanceRequest<BottleProxy, Void> remove();

	/**
	 * MAJ
	 */
	InstanceRequest<BottleProxy, Void> update();

	/**
	 * Recupere les bouteilles selon un critere
	 * 
	 * @param criteria
	 * @return
	 */
	Request<List<BottleProxy>> findBottlesByCriteria(String criteria);

}
